﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AiTool_Window
{
    /// <summary>
    /// Text2AudioSetting.xaml 的交互逻辑
    /// </summary>
    public partial class Text2AudioSetting : Window
    {
        public Text2AudioSetting()
        {
            InitializeComponent();
        }

        private void btnApply_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void sli语速_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            txt语速.Text = Math.Round(e.NewValue, 2, MidpointRounding.ToZero).ToString();
        }

        private void sli音量_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            txt音量.Text = Math.Round(e.NewValue, 2, MidpointRounding.ToZero).ToString();
        }

        private void sli语调_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            txt语调.Text = Math.Floor(e.NewValue).ToString();
        }
    }
}
